package com.bootdo.site.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.common.domain.LogDO;
import com.bootdo.common.domain.PageDO;
import com.bootdo.common.utils.Query;
import com.bootdo.site.dao.SiteDao;
import com.bootdo.site.domain.SiteDO;
import com.bootdo.site.service.SiteService;

@Service
public class SiteServiceImpl implements SiteService {

	@Autowired
	SiteDao siteMapper;

	@Override
	public PageDO<SiteDO> queryList(Query query) {

		int total = siteMapper.count(query);
		List<SiteDO> site = siteMapper.list(query);
		PageDO<SiteDO> page = new PageDO<>();
		page.setTotal(total);
		page.setRows(site);
		return page;
	}

	@Override
	public int remove(Long id) {
		int count = siteMapper.remove(id);
		return count;
	}

	@Override
	public int batchRemove(Long[] ids) {
		return siteMapper.batchRemove(ids);
	}

	@Override
	public SiteDO get(Long id) {
		return siteMapper.get(id);
	}

	@Override
	public int count(Map<String, Object> map) {
		return siteMapper.count(map);
	}

	@Override
	public int save(SiteDO site) {
		return siteMapper.save(site);
	}

	@Override
	public int update(SiteDO site) {
		return siteMapper.update(site);
	}

	@Override
	public List<SiteDO> listType() {
		return siteMapper.listType();
	}

	@Override
	public String getName(String type, String value) {
		// TODO Auto-generated method stub
		return null;
	}

}
